package iv1201project.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;

/**
 * A DTO with information about an applicant.
 */
public class ApplicantDTO implements Serializable {
    private String name;
    private String surname;
    private String email;
    private ArrayList<BigDecimal> yearsOfExp;
    private ArrayList<Competence> areaOfExp;
    private ArrayList<String> toDateAvail;
    private ArrayList<String> fromDateAvail;
    private String summary = "";

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the surname
     */
    public String getSurname() {
        return surname;
    }

    /**
     * @param surname the surname to set
     */
    public void setSurname(String surname) {
        this.surname = surname;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the yearsOfExp
     */
    public ArrayList<BigDecimal> getYearsOfExp() {
        return yearsOfExp;
    }

    /**
     * @param yearsOfExp the yearsOfExp to set
     */
    public void setYearsOfExp(ArrayList<BigDecimal> yearsOfExp) {
        this.yearsOfExp = yearsOfExp;
    }

    /**
     * @return the areaOfExp
     */
    public ArrayList<Competence> getAreaOfExp() {
        return areaOfExp;
    }

    /**
     * @param areaOfExp the areaOfExp to set
     */
    public void setAreaOfExp(ArrayList<Competence> areaOfExp) {
        this.areaOfExp = areaOfExp;
    }

    /**
     * @return the toDateAvail
     */
    public ArrayList<String> getToDateAvail() {
        return toDateAvail;
    }

    /**
     * @param toDateAvail the toDateAvail to set
     */
    public void setToDateAvail(ArrayList<String> toDateAvail) {
        this.toDateAvail = toDateAvail;
    }

    /**
     * @return the fromDateAvail
     */
    public ArrayList<String> getFromDateAvail() {
        return fromDateAvail;
    }

    /**
     * @param fromDateAvail the fromDateAvail to set
     */
    public void setFromDateAvail(ArrayList<String> fromDateAvail) {
        this.fromDateAvail = fromDateAvail;
    }
    
    /**
     * 
     * @return the generated string.
     */
    private String genSummary(){
        String tmp = "";
        tmp += name + " " + surname + "<br />" + email + "<br />";
        for(int i = 0; i < areaOfExp.size(); i++)
            tmp += areaOfExp.get(i).getName() + " " + yearsOfExp.get(i) + "<br />";
        for(int i = 0; i < fromDateAvail.size(); i++)
            tmp += fromDateAvail.get(i) + " " + toDateAvail.get(i) + "<br />";
        return tmp;
    }

    /**
     * @return the summary
     */
    public String getSummary() {
        return genSummary();
    }

    /**
     * @param summary the summary to set
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }
}
